﻿<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>

    <title>Program dogajanja na TUK-u</title>

﻿   <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"/>


      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>

      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>

      <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>

      <script type="text/javascript">

          function loadXMLDoc() {
              var xmlhttp = new XMLHttpRequest();
              xmlhttp.open("POST", "http://164.8.251.99:9793/services/cir2012/SiNf_StukProg?wsdl", false);
              xmlhttp.onreadystatechange = function () {
                  if (xmlhttp.readyState == 4) {
                      var xmlString = xmlhttp.responseText;

                      var parser = new DOMParser();
                      var xmlDoc = parser.parseFromString(xmlString, "application/xml");

                      var stevilo = xmlDoc.getElementsByTagName("dogodek");

                      for (var i = 0; i < stevilo.length; i++) {
                          var povezava = xmlDoc.getElementsByTagName("dogodek")[i].getAttribute("povezava");
                          //var povezavaGM = xmlDoc.getElementsByTagName("dogodek")[i].getAttribute("povezavaZemljevid");
                          var obvestilo = xmlDoc.getElementsByTagName("dogodek")[i].childNodes[0].nodeValue;

                          document.getElementById("main").innerHTML += "<a href='" + povezava + "'>" + obvestilo + "</a><br/><a href='http://www.bing.com/maps/?v=2&where1=gosposvetska%20cesta%2083,%20maribor'>Lokacija</a><br/><br/>";
                      }

                  }
              }

              xmlhttp.setRequestHeader("SOAPAction", "vrniProgramDogajanja");
              xmlhttp.setRequestHeader("Content-Type", "text/xml");
              var xml = '<?xml version="1.0" encoding="utf-8"?>' +
                 '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                                'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
                                'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                   '<soap:Body> ' +
                     '<vrniProgramDogajanja xmlns="http://services.mashup.wso2.org/SiNf_StukProg"> ' +
                     '</vrniProgramDogajanja> ' +
                   '</soap:Body> ' +
                 '</soap:Envelope>';
              xmlhttp.send(xml);



          }

          document.addEventListener("deviceready", loadXMLDoc, false);

        </script>

</head>

<body>
    <h1>Program dogajanja na ŠTUK-u</h1>
    <div id="main"></div>
</body>

</html>
